<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>

<script>

        function saveCustomServiceStl(urls){

            if($("#settle_credit_maxfee").val() != null
                && $("#settle_credit_maxfee").val() != ""
                && $("#settle_credit_maxfee").val() != parseFloat(0.00)
                && $("#settle_credit_minfee").val()!=null
                && $("#settle_credit_minfee").val()!=""
                && $("#settle_credit_minfee").val() != parseFloat(0.00)
                && parseFloat($("#settle_credit_minfee").val()) > parseFloat($("#settle_credit_maxfee").val())){
                $.jpmessage.info('贷记卡最大手续费不能小于最小手续费!');
                return;
            }
            if($("#settle_debit_maxfee").val() != null
                && $("#settle_debit_maxfee").val() != ""
                && $("#settle_debit_maxfee").val() != parseFloat(0.00)
                && $("#settle_debit_minfee").val()!=null
                && $("#settle_debit_minfee").val()!=""
                && $("#settle_debit_minfee").val() != parseFloat(0.00)
                && parseFloat($("#settle_debit_minfee").val()) > parseFloat($("#settle_debit_maxfee").val())){
                $.jpmessage.info('借记卡最大手续费不能小于最小手续费!');
                return;
            }
            if($("#customServiceParamStlForm").form("validate")){
                var options ={
                    url:urls,
                    type:'post',
                    success : function(data){
                        if("success" == data.code){
                            $.jpmessage.info('保存成功!',function(){
                                window.location.reload();
                            });
                        }else if("error" == data.code){
                            $.jpmessage.error(data.message);
                        }
                    }
                };
                $("#customServiceParamStlForm").ajaxSubmit(options);
            }

        }

</script>

        <div class="easyui-panel" style="width:98%;">
            <div style="padding:10px 10px 10px 10px">
                <form id="customServiceParamStlForm"  name="customServiceParamStlForm" method="post">
                    <input type="hidden" name="ins_uuid" value="${ins_uuid}"/>
                    <input type="hidden" name="service_uuid" value="${service_uuid}"/>
                    <input type="hidden" name="service_param_uuid" value="${service_param_uuid}"/>
                    <input type="hidden" name="custom_param_uuid" value="${appCustomServiceParamStlEntity.custom_param_uuid}"/>
                    <input type="hidden" name="rec_id" value="${appCustomServiceParamStlEntity.rec_id}"/>
                    <div class="easyui-panel" title="贷记卡" style="width:100%;height:150px;padding:5px;" data-options="collapsible:true">
                        <table cellpadding="5" style="width:100%">
                            <tr>
                                <td>扣率(万分位):</td>
                                <td><input class="easyui-numberspinner" name="settle_credit_rate" data-options="precision:0,min:0,max:10000" value="${appCustomServiceParamStlEntity.settle_credit_rate}"></input></td>
                                <td>附加手续费:</td>
                                <td><input class="easyui-numberspinner" name="settle_credit_attachfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appCustomServiceParamStlEntity.settle_credit_attachfee}"></input></td>
                            </tr>
                            <tr>
                                <td>最小手续费:</td>
                                <td><input class="easyui-numberspinner" id="settle_credit_minfee" name="settle_credit_minfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appCustomServiceParamStlEntity.settle_credit_minfee}"></input></td>
                                <td>最大手续费:</td>
                                <td><input class="easyui-numberspinner" id="settle_credit_maxfee" name="settle_credit_maxfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appCustomServiceParamStlEntity.settle_credit_maxfee}"></input></td>
                            </tr>
                        </table>
                    </div>
                    <div class="easyui-panel" title="借记卡" style="width:100%;height:150px;padding:5px;" data-options="collapsible:true">
                        <table cellpadding="5" style="width:100%">
                            <tr>
                                <td>扣率(万分位):</td>
                                <td><input class="easyui-numberspinner" name="settle_debit_rate" data-options="precision:0,min:0,max:10000" value="${appCustomServiceParamStlEntity.settle_debit_rate}"></input></td>
                                <td>附加手续费:</td>
                                <td><input class="easyui-numberspinner" name="settle_debit_attachfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appCustomServiceParamStlEntity.settle_debit_attachfee}"></input></td>
                            </tr>
                            <tr>
                                <td>最小手续费:</td>
                                <td><input class="easyui-numberspinner" id="settle_debit_minfee" name="settle_debit_minfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appCustomServiceParamStlEntity.settle_debit_minfee}"></input></td>
                                <td>最大手续费:</td>
                                <td><input class="easyui-numberspinner" id="settle_debit_maxfee" name="settle_debit_maxfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appCustomServiceParamStlEntity.settle_debit_maxfee}"></input></td>
                            </tr>
                        </table>
                    </div>
                    <div class="easyui-panel" title="固定金额" style="width:100%;height:80px;padding:5px;" data-options="collapsible:true">
                        <table cellpadding="5" style="width:100%">
                            <tr>
                                <td>默认金额:</td>
                                <td><input class="easyui-numberspinner" name="fixed_amt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appCustomServiceParamStlEntity.fixed_amt}"></input></td>
                                <td></td>
                                <td></td>
                            </tr>
                        </table>
                    </div>
                    <div style="text-align:center;padding:5px">
                       <%-- <a href="javascript:void(0)" class="easyui-linkbutton btn detail-remove" iconCls="icon-save" id="saveBtn">保存</a>--%>
                           <c:if test="${insLevel == '1' ||  (insLevel != '1' && insUuid != ins_uuid)}">
                               <jiepos:buttonDetailTag menuCode="${menuCode}" buttonCode="CUSTOMSERVPARMSTL_BTN_SAVE" hideBack="true" formId="customServiceParamStlForm"></jiepos:buttonDetailTag>
                           </c:if>
                    </div>
                </form>
            </div>
        </div>